<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<script type="text/javascript"
	src="<c:url value="/js/html5/html5.min.js"/>">
	
</script>
<script type="text/javascript"
	src="<c:url value="/js/respond/respond.min.js"/> "></script>
<script type="text/javascript"
	src="<c:url value="/js/PIE/2.0/PIE_IE678.js"/>"></script>

<link href="<c:url value="/css/H-ui.min.css"/>" rel="stylesheet"
	type="text/css" />
<link href="<c:url value="/css/H-ui.login.css"/>" rel="stylesheet"
	type="text/css" />
<link href="<c:url value="/css/Hui-iconfont/1.0.1/iconfont.css"/>"
	rel="stylesheet" type="text/css" />
<%--分页--%>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/layer/laypage.css"/>">
<title>项目管理</title>
</head>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
		项目管理<span class="c-gray en">&gt;</span> 投资人列表<a
			class="btn btn-success radius r mr-20"
			style="line-height: 1.6em; margin-top: 3px"
			href="<c:url value ="/admin/project/list/0"/>" title="返回"><i
			class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="pd-20">

		<table
			class="table table-border table-bordered table-hover table-bg table-sort"
			id="content">
			<thead>
				<tr class="text-c">
					<th>投资人昵称</th>
					<th>投资时间</th>
					<th>投资人真实姓名</th>
					<th>投资人联系方式</th>
					<th>投资金额</th>
					<th>投资状态</th>
					<th>操作</th>
				</tr>
				<c:forEach items="${viewData}" var="investments">
					<tr class="text-c">
						<td>${investments.user.userName }</td>
						<td><fmt:formatDate value="${investments.createTime}" type="date" dateStyle="medium"/></td>
						<td>${investments.user.userRealName }</td>
						<td>${investments.user.phoneNumber }</td>
						<td>${investments.amount }</td>
						<td><c:if test="${investments.status==0 }">未知状态</c:if> <c:if
								test="${investments.status==1 }">已支付保证金</c:if> <c:if
								test="${investments.status==2 }">已签合同</c:if> <c:if
								test="${investments.status==3 }">取消投资</c:if></td>
						<td><c:if test="${investments.status==1 }">
								<a href="#"
									onclick="changeStatus('${investments.id}',2,'是否设置为已签合同？')">设置为已签合同</a>&nbsp;<!-- <a
									href="#"
									onclick="changeStatus('${investments.id}',3,'是否取消该用户的投资？')">取消该用户投资</a> -->
							</c:if> <c:if test="${investments.status != 1 }">
								无操作项
							</c:if></td>
					</tr>
				</c:forEach>
			</thead>
			<tbody>
			</tbody>
		</table>
	</div>
	<%--分页--%>
	<script type="text/javascript"
		src="<c:url value="/js/laypage/1.2/laypage.js"/>"></script>
	<script type="text/javascript"
		src="<c:url value="/js/jquery/1.9.1/jquery.min.js"/>"></script>
	<script type="text/javascript"
		src="<c:url value="/js/layer/1.9.3/layer.js"/>"></script>
	<script type="text/javascript"
		src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type="text/javascript"
		src="<c:url value="/js/h-ui/2.3/H-ui.js"/>"></script>
	<script type="text/javascript"
		src="<c:url value="/js/h-ui/2.3/H-ui.admin.js"/>"></script>
	<script type="text/javascript">
		function changeStatus(id, status, message) {
			layer.confirm(message, {
				btn : [ '是', '取消' ],
				shade : false
			}, function() {
				$.ajax({
					type : "post",
					dataType : "json",
					data : {
						id : id,
						status : status
					},
					url : "<c:url value="/admin/project/changInvestStatus"/>",
					success : function(data, textStatus) {
						layer.msg(data.msg, {
							icon : 6,
							time : 1000
						}, function() {
							location.reload(true);
						});
					},
					error : function(data) {
						layer.msg(data.msg, {
							icon : 5,
							time : 1000
						});
					}
				});
			});
		}
	</script>
</body>
</html>